From 4a7e2e6fbfb1bc73c8f0384ae37a088b42c794fd Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Fri, 28 Jan 2005 13:54:34 +0000 Subject: [PATCH] bitkeeper revision 1.1159.231.14 (41fa441azB6742PriyqlRlCP_gJ0Tw) Build and x86/64 fixes. Signed-off-by: keir.fraser@cl.cam.ac.uk --- BitKeeper/etc/logging_ok | 1 + xen/arch/x86/Makefile | 1 + xen/arch/x86/boot/x86_64.S | 6 +++--- xen/arch/x86/domain.c | 15 ++++++++++----- xen/arch/x86/e820.c | 21 +++++++++++++-------- xen/arch/x86/memory.c | 2 ++ xen/arch/x86/x86_32/xen.lds | 6 +++--- xen/arch/x86/x86_64/xen.lds | 6 +++--- xen/include/asm-x86/mm.h | 1 + xen/include/public/arch-x86_64.h | 1 + 10 files changed, 38 insertions(+), 22 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index d14c442f66..9079494d08 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -26,6 +26,7 @@ iap10@tetris.cl.cam.ac.uk jws22@gauntlet.cl.cam.ac.uk jws@cairnwell.research kaf24@camelot.eng.3leafnetworks.com +kaf24@firebug.cl.cam.ac.uk kaf24@freefall.cl.cam.ac.uk kaf24@labyrinth.cl.cam.ac.uk kaf24@pb001.cl.cam.ac.uk diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index e6f6f561b5..342b8feba9 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -15,6 +15,7 @@ OBJS := $(subst $(TARGET_SUBARCH)/asm-offsets.o,,$(OBJS)) ifneq ($(TARGET_SUBARCH),x86_32) OBJS := $(subst vmx.o,,$(OBJS)) OBJS := $(subst vmx_io.o,,$(OBJS)) +OBJS := $(subst vmx_platform.o,,$(OBJS)) OBJS := $(subst vmx_vmcs.o,,$(OBJS)) endif diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S index 875584126e..73a513f9b6 100644 --- a/xen/arch/x86/boot/x86_64.S +++ b/xen/arch/x86/boot/x86_64.S @@ -156,7 +156,8 @@ __high_start: lea start(%rip),%rax sub $0x100000,%rax add %rax,%rdi - call cmain + call __start_xen + ud2 /* Force a panic (invalid opcode). */ /* This is the default interrupt handler. */ int_msg: @@ -264,10 +265,9 @@ phys_to_machine_mapping: copy_from_user: show_registers: do_iopl: -.globl idt_table, copy_user_generic, memcmp, idt_tables, new_thread +.globl idt_table, copy_user_generic, idt_tables, new_thread idt_table: copy_user_generic: -memcmp: idt_tables: new_thread: .globl switch_to, __get_user_1, __get_user_4, __get_user_8, trap_init diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 8558c52627..6270c09985 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -364,8 +364,6 @@ static void monitor_rm_pagetable(struct exec_domain *ed) l2_pgentry_t *mpl2e; unsigned long mpfn; - ASSERT( m->monitor_table ); - mpl2e = (l2_pgentry_t *) map_domain_mem(pagetable_val(m->monitor_table)); /* * First get the pfn for guest_pl2e_cache by looking at monitor_table @@ -510,8 +508,10 @@ int arch_final_setup_guestos(struct exec_domain *d, full_execution_context_t *c) } } +#ifdef CONFIG_VMX if (c->flags & ECF_VMX_GUEST) return vmx_final_setup_guestos(d, c); +#endif return 0; } @@ -747,6 +747,7 @@ static void relinquish_list(struct domain *d, struct list_head *list) spin_unlock_recursive(&d->page_alloc_lock); } +#ifdef CONFIG_VMX static void vmx_domain_relinquish_memory(struct exec_domain *ed) { struct domain *d = ed->domain; @@ -776,6 +777,7 @@ static void vmx_domain_relinquish_memory(struct exec_domain *ed) } } +#endif void domain_relinquish_memory(struct domain *d) { @@ -788,15 +790,18 @@ void domain_relinquish_memory(struct domain *d) shadow_mode_disable(d); /* Drop the in-use reference to the page-table base. */ - for_each_exec_domain(d, ed) { + for_each_exec_domain ( d, ed ) + { if ( pagetable_val(ed->mm.pagetable) != 0 ) put_page_and_type(&frame_table[pagetable_val(ed->mm.pagetable) >> PAGE_SHIFT]); } - if (VMX_DOMAIN(d->exec_domain[0])) - for_each_exec_domain(d, ed) +#ifdef CONFIG_VMX + if ( VMX_DOMAIN(d->exec_domain[0]) ) + for_each_exec_domain ( d, ed ) vmx_domain_relinquish_memory(ed); +#endif /* * Relinquish GDT mappings. No need for explicit unmapping of the LDT as diff --git a/xen/arch/x86/e820.c b/xen/arch/x86/e820.c index 50f1b5fc8b..cf78c21844 100644 --- a/xen/arch/x86/e820.c +++ b/xen/arch/x86/e820.c @@ -305,17 +305,11 @@ static unsigned long __init find_max_pfn(void) return max_pfn; } -static void __init machine_specific_memory_setup( - struct e820entry *raw, int raw_nr) +#ifdef __i386__ +static void __init clip_4gb(void) { - char nr = (char)raw_nr; int i; - sanitize_e820_map(raw, &nr); - - (void)copy_e820_map(raw, nr); - -#ifdef __i386__ /* 32-bit systems restricted to a 4GB physical memory map. */ for ( i = 0; i < e820.nr_map; i++ ) { @@ -335,7 +329,18 @@ static void __init machine_specific_memory_setup( e820.nr_map = i + 1; } } +} +#else +#define clip_4gb() ((void)0) #endif + +static void __init machine_specific_memory_setup( + struct e820entry *raw, int raw_nr) +{ + char nr = (char)raw_nr; + sanitize_e820_map(raw, &nr); + (void)copy_e820_map(raw, nr); + clip_4gb(); } unsigned long init_e820(struct e820entry *raw, int raw_nr) diff --git a/xen/arch/x86/memory.c b/xen/arch/x86/memory.c index 739dda8ef2..69bca437d9 100644 --- a/xen/arch/x86/memory.c +++ b/xen/arch/x86/memory.c @@ -148,6 +148,7 @@ unsigned long max_page; void __init init_frametable(void) { +#ifdef __i386__ unsigned long i, p; frame_table = (struct pfn_info *)FRAMETABLE_VIRT_START; @@ -164,6 +165,7 @@ void __init init_frametable(void) } memset(frame_table, 0, frame_table_size); +#endif } void arch_init_memory(void) diff --git a/xen/arch/x86/x86_32/xen.lds b/xen/arch/x86/x86_32/xen.lds index 537ebf15ba..1ad91a14b5 100644 --- a/xen/arch/x86/x86_32/xen.lds +++ b/xen/arch/x86/x86_32/xen.lds @@ -25,12 +25,12 @@ SECTIONS .rodata : { *(.rodata) *(.rodata.*) } :text .kstrtab : { *(.kstrtab) } :text - . = ALIGN(16); /* Exception table */ + . = ALIGN(32); /* Exception table */ __start___ex_table = .; __ex_table : { *(__ex_table) } :text __stop___ex_table = .; - . = ALIGN(16); /* Pre-exception table */ + . = ALIGN(32); /* Pre-exception table */ __start___pre_ex_table = .; __pre_ex_table : { *(__pre_ex_table) } :text __stop___pre_ex_table = .; @@ -57,7 +57,7 @@ SECTIONS __init_begin = .; .text.init : { *(.text.init) } :text .data.init : { *(.data.init) } :text - . = ALIGN(16); + . = ALIGN(32); __setup_start = .; .setup.init : { *(.setup.init) } :text __setup_end = .; diff --git a/xen/arch/x86/x86_64/xen.lds b/xen/arch/x86/x86_64/xen.lds index 8a6b3a27ac..f5072c3a05 100644 --- a/xen/arch/x86/x86_64/xen.lds +++ b/xen/arch/x86/x86_64/xen.lds @@ -23,12 +23,12 @@ SECTIONS .rodata : { *(.rodata) *(.rodata.*) } :text .kstrtab : { *(.kstrtab) } :text - . = ALIGN(16); /* Exception table */ + . = ALIGN(32); /* Exception table */ __start___ex_table = .; __ex_table : { *(__ex_table) } :text __stop___ex_table = .; - . = ALIGN(16); /* Pre-exception table */ + . = ALIGN(32); /* Pre-exception table */ __start___pre_ex_table = .; __pre_ex_table : { *(__pre_ex_table) } :text __stop___pre_ex_table = .; @@ -55,7 +55,7 @@ SECTIONS __init_begin = .; .text.init : { *(.text.init) } :text .data.init : { *(.data.init) } :text - . = ALIGN(16); + . = ALIGN(32); __setup_start = .; .setup.init : { *(.setup.init) } :text __setup_end = .; diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h index 180d83e37d..3c96144256 100644 --- a/xen/include/asm-x86/mm.h +++ b/xen/include/asm-x86/mm.h @@ -225,6 +225,7 @@ void synchronise_pagetables(unsigned long cpu_mask); #ifdef __x86_64__ extern unsigned long *machine_to_phys_mapping; extern unsigned long *phys_to_machine_mapping; +#define m2p_start_mfn virt_to_phys(machine_to_phys_mapping) #else /* Don't call virt_to_phys on this: it isn't direct mapped. Using m2p_start_mfn instead. */ diff --git a/xen/include/public/arch-x86_64.h b/xen/include/public/arch-x86_64.h index abba7bdf12..4b6fec3ece 100644 --- a/xen/include/public/arch-x86_64.h +++ b/xen/include/public/arch-x86_64.h @@ -115,6 +115,7 @@ typedef u64 tsc_timestamp_t; /* RDTSC timestamp */ */ typedef struct { #define ECF_I387_VALID (1<<0) +#define ECF_VMX_GUEST (2<<0) unsigned long flags; execution_context_t cpu_ctxt; /* User-level CPU registers */ char fpu_ctxt[512]; /* User-level FPU registers */ -- 2.30.2